<ui:composition xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core"
	template="template/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msgs.selectivePrioritization}"/>
	</ui:define>
	<ui:define name="bodyInclude">
		<ui:include src="include/menu.xhtml" />
		<h:form id="selectivePrioritizationForm">
			<p:fieldset legend="#{msgs.selectivePrioritization}: #{selectivePrioritizationController.currentHierarchy.project.name} - #{selectivePrioritizationController.currentHierarchy.version.name}" styleClass="right" toggleable="true" toggleSpeed="300">
				<p:commandButton alt="#{msgs.referenceTable}" image="ui-icon ui-icon-help" onclick="dialogSelectiveReferenceTableVar.show()" styleClass="helpButton" type="button" title="#{msgs.referenceTable}" value="#{msgs.referenceTable}" />
				<h:panelGrid cellpadding="5" columns="2" styleClass="center width100">
					<p:commandLink oncomplete="dialogCostValueChartFullScreen.show()" process="@this" type="submit" update="dialogCostValueChartFullScreenForm:fullCostValueImage">
						<p:graphicImage alt="#{msgs.clickToOpenFullScreenMode}" id="costValueImage" styleClass="diagramMicroImage" value="#{selectivePrioritizationController.costValueChart}" title="#{msgs.clickToOpenFullScreenMode}">
							<f:param name="timestamp" value="#{sessionController.currentTimestamp}"/>
						</p:graphicImage>
					</p:commandLink>
					<p:commandLink oncomplete="dialogFitRiskChartFullScreen.show()" process="@this" type="submit" update="dialogFitRiksChartFullScreenForm:fullFitRiskImage">
						<p:graphicImage alt="#{msgs.clickToOpenFullScreenMode}" id="fitRiskImage" styleClass="diagramMicroImage" value="#{selectivePrioritizationController.fitRiskChart}" title="#{msgs.clickToOpenFullScreenMode}">
							<f:param name="timestamp" value="#{sessionController.currentTimestamp}"/>
						</p:graphicImage>
					</p:commandLink>
				</h:panelGrid>
				<p:outputPanel layout="block" styleClass="center container">
					<h:panelGrid columns="1" styleClass="width100">
						<h:panelGroup id="selectionGroup" rendered="#{not selectivePrioritizationController.selectivePrioritizationCompleted}" styleClass="buttonContainer">
							<h:outputLabel for="selectionTypeInput" styleClass="bold" value="#{msgs.selectionType}: "/>
							<h:selectOneMenu id="selectionTypeInput" value="#{selectivePrioritizationController.selectedSelectionType}">
								<f:selectItems value="#{selectivePrioritizationController.selectionTypes}"/>
							</h:selectOneMenu>
							<p:commandButton action="#{selectivePrioritizationController.onSelectPrioritizationType}" alt="#{msgs.prioritize}" image="ui-icon-copy" title="#{msgs.prioritize}" update="selectivePrioritizationForm:costValueImage  selectivePrioritizationForm:selectionGroup selectivePrioritizationForm:selectionResultGroup" value="#{msgs.prioritize}" />
						</h:panelGroup>
						<h:panelGroup id="selectionResultGroup" rendered="#{selectivePrioritizationController.selectivePrioritizationCompleted}" styleClass="buttonContainer">
							<h:outputText styleClass="bold" value="#{msgs.results}: "/>
							<h:panelGroup>
								<h:outputText value="-"/>
								<h:outputText value="#{selectivePrioritizationController.reductionRate}">
									<f:convertNumber maxFractionDigits="2" />
								</h:outputText>
								<h:outputText value="% "/>
							</h:panelGroup>
							<h:outputText styleClass="bold" value="#{msgs.selectedScripts}: "/>
							<h:outputText value="#{fn:length(selectivePrioritizationController.selectedCostResults)}"/>
						</h:panelGroup>
						<p:commandButton action="#{iterationAssignmentController.onStartingIterationAssignment}" alt="#{msgs.back}" image="ui-icon ui-icon-arrowthick-1-w" process="@this" title="#{msgs.back}" value="#{msgs.back}">
							<f:setPropertyActionListener target="#{iterationAssignmentController.currentHierarchy}" value="#{selectivePrioritizationController.currentHierarchy}"/>
						</p:commandButton>
					</h:panelGrid>
				</p:outputPanel>
			</p:fieldset>
		</h:form>
		<ui:include src="dialog/dialogSelectiveReferenceTable.xhtml" />
		<ui:include src="dialog/dialogCostValueChartFullScreenMode.xhtml" />
		<ui:include src="dialog/dialogFitRiskChartFullScreenMode.xhtml" />
	</ui:define>
</ui:composition>